enchancer_mod = {
  init: function  () {
      this.upload.init();
  },
  upload: {
      javalink: 'Uploadphoto.wizard.clean_wizard_open.click(\'?m=Uploadphoto&func=index&ajax=1&store=0&ajax_target=light_box\', [], {"url_activex_installer":"?m=Installactivex&func=index&ajax=1&store=0&ajax_target=light_box","url_java_installer":"?m=Uploadphoto&func=view_install_java&ajax=1&store=0&ajax_target=light_box","dont_want_premium_cookie":"dont_want_premium","client_uploader_param_name":"uploader","constants":{"activex":"ax","java":"jv","web":"web"},"activex":{"install_task_cookie":"install_activex_task","installation_task":"install","update_task":"update","install_step_cookie":"install_activex_step"},"installers":{"previous_hash_cookie":"uploader_installation_previous_hash","onload_lightbox_url_cookie":"reload_lightbox_url","onload_lightbox_width_cookie":"reload_lightbox_width"},"lightbox_id":"light_box","width":320});',
      normalink: 'Uploadphoto.basic.open.click(\'?m=Uploadphoto&func=view_basic_upload&ajax=1&store=0&ajax_target=light_box\', [], {"can_use_premium_param_name":"can_use_premium","constants":{"activex":"ax","java":"jv","web":"web"},"lightbox_id":"light_box","field_focus":false});',
      idButton: 'photo_upload_subheader_button',
      init: function () {
          var button = document.getElementById(this.idButton);

          if (!button) {
              console.error('enchancer_mod.java: no se encuentra el boton');
              return;
          }

          button.onclick = this.onclick;
      },
      onclick: function () {
            var self = enchancer_mod.upload;
            var code;

            if (tuenti_lib.config.get().javaUpload)
                code = self.javalink;
            else
                code = self.normalink;

            eval(code);
            return false;
      }
  }
};

enchancer_mod.init();